# Copyright (c) 2023, AgiBot Inc.
# All rights reserved.

include(FetchContent)

message(STATUS "get yalantinglibs ...")

# yalantinglibs version: https://gitee.com/oj-code/yalantinglibs/tags
set(yalantinglibs_DOWNLOAD_URL
    "https://gitee.com/oj-code/yalantinglibs/repository/archive/lts-1.1.0.zip"
    CACHE STRING "")

if(yalantinglibs_LOCAL_SOURCE)
  FetchContent_Declare(
    yalantinglibs
    SOURCE_DIR ${yalantinglibs_LOCAL_SOURCE}
    OVERRIDE_FIND_PACKAGE)
else()
  FetchContent_Declare(
    yalantinglibs
    URL ${yalantinglibs_DOWNLOAD_URL}
    DOWNLOAD_EXTRACT_TIMESTAMP TRUE
    OVERRIDE_FIND_PACKAGE)
endif()

# Wrap it in a function to restrict the scope of the variables
function(get_yalantinglibs)
  FetchContent_GetProperties(yalantinglibs)
  if(NOT yalantinglibs_POPULATED)
    FetchContent_MakeAvailable(yalantinglibs)

  endif()
endfunction()

get_yalantinglibs()

# import targets:
# yalantinglibs::libyalantinglibs
